// js来操作cookie的第三方包
import Cookies from 'js-cookie'
// 为什么使用cookie而不是用localStorage?
// cookie发生请求就会自动携带

const TokenKey = 'vue_admin_template_token'
// cookie中取vue_admin_template_token
export function getToken() {
  return Cookies.get(TokenKey)
}
// cookie中设置vue_admin_template_token
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
// cookie中删除vue_admin_template_token
export function removeToken() {
  return Cookies.remove(TokenKey)
}
